package com.disruptor.sample._08complex01.consumer;

import com.disruptor.sample._07advance.dto.Trade;
import com.lmax.disruptor.EventHandler;
import com.lmax.disruptor.WorkHandler;
import lombok.extern.slf4j.Slf4j;

@Slf4j
public class Handler1 implements EventHandler<Trade>,WorkHandler<Trade> {

  @Override
  public void onEvent(Trade event, long sequence, boolean endOfBatch) throws Exception {
    this.onEvent(event);
  }

  @Override
  public void onEvent(Trade event) throws Exception {
    log.info("handler1: set name");
    event.setName("h1");
    Thread.sleep(1000);
  }

}